﻿NAMFox.ns(function() { with (NAMFox) {

name("Transformers Tests");

//////////////////////////////////////////////
// Helpers
//////////////////////////////////////////////

var gamespotTests = [
    { input: "http://www.gamespot.com/video/943711/6187403/street-fighter-iv-official-trailer-2", expected: "6187403" },
    { input: "http://www.gamespot.com/ds/rpg/wonderfulworld/video/6202640/best-of-2008-game-of-the-year", expected: "6202640" },
];
var gametrailersTests = [
    { input: "http://www.gametrailers.com/player/44119.html", expected: "44119" }
];
var gametrailersUserTests = [
    { input: "http://www.gametrailers.com/player/usermovies/114364.html", expected: "114364" }
];
var gamevideosTests = [
    { input: "http://gamevideos.com/video/id/13971", expected: "13971" },
    { input: "http://gamevideos.1up.com/video/id/13971", expected: "13971" }
];
var youtubeTests = [
    { input: "http://www.youtube.com/watch?v=bkysjcs5vFU", expected: "bkysjcs5vFU" },
    { input: "http://www.youtube.com/watch?v=jgqxQmAbTBc&feature=related", expected: "jgqxQmAbTBc" },
    { input: "http://youtube.com/watch?v=bkysjcs5vFU", expected: "bkysjcs5vFU" },
    { input: "http://youtube.com/watch?v=jgqxQmAbTBc&feature=related", expected: "jgqxQmAbTBc" }
];

//////////////////////////////////////////////
// Test Cases
//////////////////////////////////////////////

test("Gamespot tests", function() {
    for (var i = 0; i < gamespotTests.length; ++i) {
        var testCase = gamespotTests[i];
        equals(testCase.expected, $.transformers.gamespot(testCase.input), "The expected output and actual output should match.");
    }
});

test("Gametrailers tests", function() {
    for (var i = 0; i < gametrailersTests.length; ++i) {
        var testCase = gametrailersTests[i];
        equals(testCase.expected, $.transformers.gametrailers(testCase.input), "The expected output and actual output should match.");
    }
});

test("Gametrailers tests", function() {
    for (var i = 0; i < gametrailersUserTests.length; ++i) {
        var testCase = gametrailersUserTests[i];
        equals(testCase.expected, $.transformers.gametrailersUser(testCase.input), "The expected output and actual output should match.");
    }
});

test("Gamevideos tests", function() {
    for (var i = 0; i < gamevideosTests.length; ++i) {
        var testCase = gamevideosTests[i];
        equals(testCase.expected, $.transformers.gamevideos(testCase.input), "The expected output and actual output should match.");
    }
});

}});